In [1]:
% matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
In [2]:
df = pd.read_csv('./population_data.csv', index_col=0)
df.head()
Out[2]:
In [4]:
df_plt = df.groupby('state')['population_fraction'].sum().reset_index()
import map_util
ax = map_util.usa_state_colormap(dict(zip(df_plt['state'], df_plt['population_fraction'])),
colorbar_title='Population fraction')
In [ ]: